<%@ include file="includes/top.jsp"%>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top" width="20%" align="left">
			<table align="left" bgcolor="#008800" border="0" cellspacing="2" cellpadding="2">
				<tr>
					<td bgcolor="#FFFF88">
						<s:a action="/shop/viewCart.do">
							<b><font color="BLACK" size="2">&lt;&lt; Shopping Cart</font></b>
						</s:a>
					</td>
				</tr>
			</table>
		</td>

		<td valign="top" align="center">
			<h2 align="center">Checkout Summary</h2>
	
			<table align="center" bgcolor="#008800" border="0" cellspacing="2" cellpadding="5">
	
				<tr bgcolor="#cccccc">
					<td><b>Item ID</b></td>
					<td><b>Product ID</b></td>
					<td><b>Description</b></td>
					<td><b>In Stock?</b></td>
					<td><b>Quantity</b></td>
					<td><b>List Price</b></td>
					<td><b>Total Cost</b></td>
				</tr>
	
				<s:iterator value="cartItem" id="${cartForm.cart.cartItemList.pageList}">
					
					<tr bgcolor="#FFFF88">
					
						<td>
							<s:a action="/shop/viewItem.do">
								<s:param name="itemId" value="${cartItem.item.itemId}"/>
								<b><s:property value="${cartItem.item.itemId}" /></b>
							</s:a>
						</td>
						
						<td><s:property value="${cartItem.item.productId}" /></td>
						
						<td><s:property value="${cartItem.item.attribute1}" /> <s:property
							value="${cartItem.item.attribute2}" /> <s:property
							value="${cartItem.item.attribute3}" /> <s:property
							value="${cartItem.item.attribute4}" /> <s:property
							value="${cartItem.item.attribute5}" /> <s:property
							value="${cartItem.item.product.name}" /></td>
						
						<td align="center"><s:property value="${cartItem.inStock}" /></td>
						
						<td align="center"><s:property value="${cartItem.quantity}" /></td>
						
						<td align="right"><fmt:formatNumber value="${cartItem.item.listPrice}" pattern="$#,##0.00" /></td>
						
						<td align="right"><fmt:formatNumber value="${cartItem.totalPrice}" pattern="$#,##0.00" /></td>
					</tr>
					
				</s:iterator>
				
				<tr bgcolor="#FFFF88">
					<td colspan="7" align="right">
						<b>Sub Total: <fmt:formatNumber value="${cartForm.cart.subTotal}" pattern="$#,##0.00" /></b>
						<br/>
					</td>
				</tr>
			</table>

			<center>
				<s:if test="${!cartForm.cart.cartItemList.firstPage}">
					<s:a href="checkout.do?page=previousCart">
						<font color="green"><B>&lt;&lt;Prev</B></font>
					</s:a>
				</s:if>
			
				<s:if test="${!cartForm.cart.cartItemList.lastPage}">
					<s:a href="checkout.do?page=nextCart">
						<font color="green"><B>Next&gt;&gt;</B></font>
					</s:a>
				</s:if>
			</center>
			
			<br>
			
			<center>
				<s:a action="/shop/newOrderForm.do">
					<img border="0" src="../images/button_continue.gif" />
				</s:a>
			</center>
		</td>

		<td valign="top" width="20%" align="right">&nbsp;</td>
	</tr>
</table>

<%@ include file="includes/bottom.jsp"%>
